package api
{
	import api_servers.api_mailserver;
	
	import flash.display.DisplayObjectContainer;

	public class clt_mailserver extends api_mailserver {
//MY UID: 8062938299454250872		
		public function clt_mailserver(root:DisplayObjectContainer) {
			super(root);
		}
		
		override public function get secrets(): Object {
			return {
						588137:'9513e1841b64ccb70449d91f3a27e785', 	// Сайтовая версия
						430262:'dd0b7ea38f1d737bd5954519db8ce756',
						478458:'0f9e0f8c1b782cf4c7b15e7d1cb05b9d'
					}
		} 
		
		public function getAlbums(uid: String, handler_: Function, onError: Function=null): void {
	    	jsrHelper([
						{pn: "method", pv: "photos.getAlbums"},
						{pn: "uid", pv: uid},
						{pn: "session_key", pv: 'none'}
	    			], handler_, 'getAlbums' + uid, true, '', null, onError);
		}
		
		public function getPhotos(uid: String, aid: String, handler_:*): void {
	    	jsrHelper([
						{pn: "method", pv: "photos.get"},
						{pn: "uid", pv: uid},
						{pn: "aid", pv: aid},
						{pn: "session_key", pv: 'none'}
	    			], handler_, 'getPhotos' + aid + uid, true);
		}
		
		override public function isAdmin():Boolean {
			return (viewer_id == '8062938299454250872') || (viewer_id == '17202575027144026534');
		}
		
	    public function getAllFriends(uid: String, handler_:*, queryID:String='getAllFriends'): void {
	    	jsrHelper([
				{pn: "method", pv: "friends.get"},
				{pn: "uid", pv: uid},
				{pn: "ext", pv: "1"},
			], handler_, queryID, true);
	    }

	    override public function getProfiles(uids: String, handler_:*, fields: String='', queryID:String=''): void {
	    	jsrHelper([
						{pn: "method", pv: "users.getInfo"},
						{pn: 'uids', pv: uids}
	    			], handler_, queryID);
	    }
	    
	    public function getAppUsers(handler_:*): void {
	    	jsrHelper([
						{pn: "method", pv: "friends.getAppUsers"},
						{pn: 'ext', pv: 0}
	    			], handler_, 'getAppUsers');
	    }

/*	    public function hasAppPermission(ext_perm: String, _handler: Function): void {
	    	jsrHelper([
						{pn: "method", pv: "users.hasAppPermission"},
						{pn: 'ext_perm', pv: ext_perm}
	    			], handler_, 'hasAppPermission');
	    }*/
	}
}